package com.xm.service.module.BOOK.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.xm.service.module.BOOK.po.Book;
import org.apache.ibatis.annotations.*;

import java.util.List;

@Mapper
public interface BookMapper extends BaseMapper<Book> {
    @Select("select * from book where book_id=#{id}")
    Book getById(int id);




    @Delete("delete from book where book_id=#{id}")
    int deleteBookById(int id);


    @Update("update book SET in_stock = #{inStock} where book_id = #{bookId}")
    int updateBookStockById(@Param("bookId") int bookId,@Param("inStock") int inStock);
}
